package com.erlin.platform.controller;


import com.erlin.platform.controller.param.AddNewUserParam;
import com.erlin.platform.controller.param.AuditStoreParam;
import com.erlin.platform.service.IElUserService;
import com.erlin.store.service.IStoreService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 后台用户表 前端控制器
 * </p>
 *
 * @author alin
 * @since 2021-05-16
 */
@RestController
@RequestMapping("/platform/el-user")
@Api(tags = "用户管理")
public class ElUserController {
    @Autowired
    private IElUserService elUserService;
    @Autowired
    private IStoreService storeService;

    @PostMapping("/addUser")
    @ApiOperation("新增用户")
    public Boolean addUser(@RequestBody AddNewUserParam param) {
        return elUserService.addUser(param);
    }

    @GetMapping("/test")
    @ApiOperation("测试")
    public boolean test() {
        return true;
    }

    @GetMapping("/getAuditStore")
    @ApiOperation("待审核商家列表")
    public PageInfo getAuditStore(){
        return storeService.getAuditStore();
    }

    @PostMapping("/auditStore")
    @ApiOperation("审核商家信息")
    public boolean auditStore(@RequestBody AuditStoreParam param){
        return storeService.auditStore(param);
    }
}
